<?php

namespace App\Admin\Extensions\Tools;

use Encore\Admin\Grid\Tools\BatchAction;

class BatchEdit extends BatchAction
{
    protected $action;
    protected $url;

    public function __construct($url)
    {
        $this->url = $url;
    }

    public function script()
    {
        return <<<EOT

        $('{$this->getElementClass()}').on('click', function() {
            location.href = "{$this->url}"+selectedRows();
        });

EOT;

    }
}
